package com.sinosun.autotestmachine.tools;

/**
 * 测试平台枚举
 * @author HYW
 *
 */
public enum TestOs {
	ANDROID(0, "android"),
	IOS(1, "ios"),
	WINDOWS(2, "windows");
	
	private int value;
	private String os;
	
	TestOs(int value, String os) {
		this.value = value;
		this.os = os;
	}
	
	public TestOs valueOf(int value) {
		switch (value) {
		case 0:
			return ANDROID;
		case 1:
			return IOS;
		case 2:
			return WINDOWS;
		default:
			break;
		}
		return null;
	}
	
	public static TestOs OSOf(String os) {
		if (os.equals(ANDROID.os)) {
			return ANDROID;
		} else if (os.equals(IOS.os)) {
			return IOS;
		} else if (os.equals(WINDOWS.os)) {
			return WINDOWS;
		}
		return null;
	}
	
	public int value() {
		return this.value;
	}
	
	public String os() {
		return this.os;
	}
}
